import requests

api_url = 'https://i-lq.snssdk.com/bds/cell/cell_comment/'
headers = {'Accept-Encoding': 'gzip',
           'X-SS-QUERIES': '******',
           'X-SS-REQ-TICKET': '1614499328380',
           'x-vc-bdturing-sdk-version': '2.0.1',
           'passport-sdk-version': '30',
           'sdk-version': '2',
           'User-Agent': 'ttnet okhttp/3.10.0.2',
           'Cookie': '******',
           'X-Khronos': '1614499329',
           'X-Gorgon': '040400a50005d14c4b04f9fa5ac0c9ec9617070b6fcfe1bff0f2',
           'Host': 'i-lq.snssdk.com',
           'Connection': 'Keep-Alive'}

param = {
    'cell_type': '1',
    'cell_id': '6884917158271260935',
    'offset': '0',
    'api_version': '1',
    'iid': '1284657529238599',
    'device_id': '1179092996603726',
    'ac': 'wifi',
    'mac_address': '54%3ABF%3A64%3A48%3A8C%3A87',
    'channel': 'baidu',
    'aid': '1319',
    'app_name': 'super',
    'version_code': '331',
    'version_name': '3.3.1',
    'device_platform': 'android',
    'ssmix': 'a',
    'device_type': 'LIO-AN00',
    'device_brand': 'Android',
    'language': 'zh',
    'os_api': '22',
    'os_version': '5.1.1',
    'uuid': '863064547881401',
    'openudid': '5c2a72be0ea16ab0',
    'manifest_version_code': '331',
    'resolution': '900*1600',
    'dpi': '320',
    'update_version_code': '33150',
    '_rticket': '1614499328336',
    'cdid': '6e3fcc11-5cc4-494f-acbe-d9887dd59e08',
    'app_region': 'CN',
    'sys_region': 'CN',
    'time_zone': 'Asia%2FShanghai',
    'app_language': 'ZH',
    'carrier_region': 'CN',
    'last_channel': '',
    'last_update_version_code': '0',
    'ts': '1614499328'
}

def parse_url():
    response = requests.get(api_url, headers=headers, params=param)
    video = response.json()['data']['cell_comments'][0]['comment_info']['item']['video']
    video_name = video['text']
    video_url = video['video_high']['url_list'][0]['url']
    print("video_name：" + video_name)
    print("video_url：" + video_url)

if __name__ == '__main__':
    parse_url()